#macro(pagination $pagination)
	<div class="pagination">
	#if($pagination.pageAmount>1)
	#if(!$pagination.firstPage)
		<a href="${pagination.baseURL}1">首页</a>	
		<a href="$pagination.baseURL$pagination.prevPage">上一页</a>
	#end
	#if($pagination.pageAmount>1)
		#foreach($p in $pagination.pages)
			#if($pagination.currentPage==$p)
			<span>$p</span>
			#else
			<a href="$pagination.baseURL$p">$p</a>
			#end
		#end
	#end
	#if(!$pagination.lastPage)
		<a href="$pagination.baseURL$pagination.nextPage">下一页</a>
		<a href="$pagination.baseURL$pagination.pageAmount">尾页</a>
	#end
	#end
	</div>
#end

#macro(script)
	<script type="text/javascript" src="$url.base/static/jquery-1.3.2.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="$url.base/static/json.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="$url.base/static/forum.js" charset="utf-8"></script>
	<script type="text/javascript" src="$url.base/static/thickbox.js" charset="utf-8"></script>
	<script type="text/javascript" src="$url.base/static/jquery.anchor.js" charset="utf-8"></script>
	##<script type="text/javascript" src="$utils.allInOne('/static/jquery-1.3.2.min.js','/static/json.min.js','/static/forum.js','/static/thickbox.js','/static/jquery.anchor.js','/static/kindeditor-3.4/kindeditor.js')" charset="utf-8"></script>
#end

#macro(headTag $title $description)
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<title>${title}_$config.siteName</title>
	<meta name="description" content="$description"/>
	<link rel="shortcut icon" href="$url.base/static/favicon.ico"/>
	<link type="text/css" href="$utils.allInOne('/static/forum.css','/static/thickbox.css')" media="screen" rel="stylesheet"/>
	#script()
#end


#macro(topicList $topicInfoList)
		<table>
			<thead>
				<tr>
					<th width="36">点击</th>
					<th width="30">回复</th>
					<th>标题</th>
					<th width="100">作者</th>
					<th width="135">最后回复</th>
				</tr>
			</thead>
			<tbody>
			#foreach($item in $topicInfoList)
				<tr #if($foreach.count%2==0)class="b1"#end>
					<td>$item.viewCount</td>
					<td>$item.replyCount</td>
					<td class="title">
						<input type="checkbox" name="selectTopic" value="$item.id"/>
						[$item.category.name] 
						<a href="$url.topic($item)">$item.title</a>
						#if($item.widgetType==1)
						[<span>投票</span>]
						#end
						#if($item.digest)
						[<span>精华</span>]
						#end
						#if($item.top)
						[<span>置顶</span>]
						<a href="javascript:forum.op.rollTopRank($item.id)">提升</a>
						#end
					</td>
					<td>
						#if($item.authorId==1)
							$item.authorNickame
						#else
							<a href="$url.base/member/$item.authorId/profile">$item.authorNickame</a>
						#end
					</td>
					<td>
						<i>$utils.dateFormat($item.lastReplyDate)</i>
						#if($item.lastReplierId==1)
							$item.lastReplierNickname
						#else
							<a href="$url.base/member/$item.lastReplierId/profile">$item.lastReplierNickname</a>
						#end
					</td>
				</tr>
			#end
				<tr style="background:#E8F3FD">
					<td colspan=2></td>
					<td>
						<input type="checkbox" onclick="$('input[name=selectTopic]').click()"/>反选
						<button onclick="forum.op.deleteSubject()">删除主题</button>
						<button onclick="forum.op.moveSubject(1,this)">移动主题</button>
						<button onclick="forum.op.topSubject()">置顶/解除置顶</button>
						<button onclick="forum.op.digestSubject()">加入/解除精华</button>
					</td>
					<td colspan=2></td>
				</tr>
			</tbody>
		</table>
#end

#macro(topbar $category $channel)
	#if($channel=='digest')
			<div class="topbar">
				<div class="left_circle"></div>
				<ul>
					<li class="box">
						<a class="a1" href="$url.category($model.rootCategory)">$model.rootCategory.name</a>
					</li>
					<li>
						<div class="left_circle"></div>
						<div class="selected"><a class="a1" href="$url.digestCategory($model.rootCategory)">精品区</a></div>
						<div class="right_circle"></div>
					</li>
					<li class="box">
						<a class="a1" href="$url.voteCategory($model.rootCategory)">投票区</a>
					</li>
				</ul>
				<div class="right_circle"></div>
			</div>
			#if($model.rootCategory.children.size()>0)
			<div class="chlid-category">
					<a href="$url.digestCategory($model.rootCategory)" class="#if($category==$model.rootCategory)current#{else}a1#end">全部</a>
					#foreach($child in $model.rootCategory.children)
					|
					<a href="$url.digestCategory($child)" class="#if($category==$child)current#{else}a1#end" >$child.name</a>
					#end
				<br class="clear"/>
			</div>
			#end
	#elseif($channel=='vote')
			<div class="topbar">
				<div class="left_circle"></div>
				<ul>
					<li class="box">
						<a class="a1" href="$url.category($model.rootCategory)">$model.rootCategory.name</a>
					</li>
					<li class="cut">&nbsp;</li>
					<li class="box">
						<a class="a1" href="$url.digestCategory($model.rootCategory)">精品区</a>
					</li>
					<li>
						<div class="left_circle"></div>
						<div class="selected"><a class="a1" href="$url.voteCategory($model.rootCategory)">投票区</a></div>
						<div class="right_circle"></div>
					</li>
				</ul>
				<div class="right_circle"></div>
			</div>
			#if($model.rootCategory.children.size()>0)
			<div class="chlid-category">
					<a href="$url.voteCategory($model.rootCategory)" class="#if($category==$model.rootCategory)current#{else}a1#end">全部</a>
					#foreach($child in $model.rootCategory.children)
					|
					<a href="$url.voteCategory($child)" class="#if($category==$child)current#{else}a1#end" >$child.name</a>
					#end
				<br class="clear"/>
			</div>
			#end
	#elseif($channel=='index')
			<div class="topbar">
				<div class="left_circle"></div>
				<ul>
					<li>
						<div class="left_circle"></div>
						<div class="selected"><a href="$url.category($model.rootCategory)">$model.rootCategory.name</a></div>
						<div class="right_circle"></div>
					</li>
					<li class="box">
						<a class="a1" href="$url.digestCategory($model.rootCategory)">精品区</a>
					</li>
					<li class="cut">&nbsp;</li>
					<li class="box">
						<a class="a1" href="$url.voteCategory($model.rootCategory)">投票区</a>
					</li>
					<li class="box">
						<a class="new_topic anchorLink" href="#new"></a>
					</li>
				</ul>
				<div class="right_circle"></div>
			</div>
			#if($model.rootCategory.children.size()>0)
			<div class="chlid-category">
					<a href="$url.category($model.rootCategory)" class="#if($category==$model.rootCategory)current#{else}a1#end">全部</a>
					#foreach($child in $model.rootCategory.children)
					|
					<a href="$url.category($child)" class="#if($category==$child)current#{else}a1#end" >$child.name</a>
					#end
				<br class="clear"/>
			</div>
			#end
	#elseif($channel=='topic')
			<div class="topbar">
				<div class="left_circle"></div>
				<ul>
					#set($higher=$model.higherLevelList($category))
					#foreach($cat in $higher)
						<li class="box">
							<a class="a1" href="$url.category($cat)">$cat.name</a>
						</li>
						<li class="arrow">&nbsp;</li>
					#end
					<li class="box">
						<a class="a1" href="$url.topic($subject)">$subject.title</a>
					</li>
				</ul>
				<div class="right_circle"></div>
			</div>
	#else
			<div class="topbar">
				<div class="left_circle"></div>
				<ul>
					<li>
						<div class="left_circle"></div>
						<div class="selected"><a href="$url.category($model.rootCategory)">$model.rootCategory.name</a></div>
						<div class="right_circle"></div>
					</li>
			</div>
	#end
	
#end